import requests

cookies = {
    'mobwapGsessionid': '02B261A0820B211F08D1B9597F83AC222',
    'TS011f0787': '01e92a7da43cfae495dee725b406e835c473be32235db3d224e316f758a39fa3fea6b30766114cc9b38a53ef6664c5a6cabdf60d21',
    'msJsessionid': '2DF5C47010AA9E4C2289E250AD2FF101',
}

headers = {
    'Accept': 'application/json',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json; charset=UTF-8',
    'Origin': 'https://wap.spdb.com.cn',
    'Referer': 'https://wap.spdb.com.cn/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-site',
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1',
    # 'Cookie': 'mobwapGsessionid=02B261A0820B211F08D1B9597F83AC222; TS011f0787=01e92a7da43cfae495dee725b406e835c473be32235db3d224e316f758a39fa3fea6b30766114cc9b38a53ef6664c5a6cabdf60d21; msJsessionid=2DF5C47010AA9E4C2289E250AD2FF101',
}

json_data = {
    'UserName': '李津',
    'CtfType': '1',
    'CtfId4': '50022519970323651X',
    'MblNo': '18323406700',
    'SubBranchId': '6800',
    'BranchId1': '6811',
    'BranchNm': '浦发银行太原北大街支行',
    'CommConNo': '201930',
    'ApntmSclr': '20',
    'ExgDate': '20250814',
    'ApplyDate': '20250424',
    'PageInfoSession': '{"domainKey":"coinrsv"}',
    'ReqHeader': {
        'AlgoType': '1',
    },
}

response = requests.post(
    'https://wap11.spdb.com.cn/mspmk-web-coinrsv/CommCoinsBookSubmit.json',
    cookies=cookies,
    headers=headers,
    json=json_data,
)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{"UserName":"李津","CtfType":"1","CtfId4":"50022519970323651X","MblNo":"18323406700","SubBranchId":"6800","BranchId1":"6811","BranchNm":"浦发银行太原北大街支行","CommConNo":"201930","ApntmSclr":"20","ExgDate":"20250814","ApplyDate":"20250424","PageInfoSession":"{\\"domainKey\\":\\"coinrsv\\"}","ReqHeader":{"AlgoType":"1"}}'.encode()
#response = requests.post(
#    'https://wap11.spdb.com.cn/mspmk-web-coinrsv/CommCoinsBookSubmit.json',
#    cookies=cookies,
#    headers=headers,
#    data=data,
#)
print(response.text)